package bs_z7;

import java.util.Random;

public class StartProblem {

	public static Reader createReader(Document doc) throws InterruptedException {
		return new Reader(doc);
	}

	public static Writer createWriter(Document doc) throws InterruptedException {
		return new Writer(doc);
	}

	public static void main(String[] args) throws InterruptedException {

		Document doc = new Document();
		Random rnd = new Random();
		for (int i = 0; i < 200; i++) {
			try {
				if (rnd.nextBoolean()) {
					createReader(doc);
				} else {
					createWriter(doc);
				}
			} catch (Exception e) {}
		}
	}
}
